function HandlePageBackendCultural(gui, operater, now, options) {
  this._gui = gui;
  this._operator = operater;
  this._now = now;
  this._options = options;
    
  this._createElements();
};

HandlePageBackendCultural.prototype._createElements = function() {
  this._loadData();
};

HandlePageBackendCultural.prototype._loadData = function() {
  this._culture = null;
  this._retrieveCulture();
};

HandlePageBackendCultural.prototype._verifyData = function() {
  if (this._culture) {
    this._updateElements();
  }
};

HandlePageBackendCultural.prototype._retrieveCulture = function() {
  var _self = this;
  if (this._options.id) {
    /*new RequestUtils()._read('iculture', null, 'd.oid = ' + this._options.id, null, null, null, null, function(result, params) { _self._culture = (result.data.length == 1) ? result.data[0] : null;
                                                                                                                                 _self._verifyData.call(_self);
                                                                                                                               }, null);*/

  var args = '&oid=' + this._options.id; 
  new RequestUtils()._mysql('iculture', args, function(result, params) { _self._culture = (result.data.length == 1) ? result.data[0] : null;
                                                                          _self._verifyData.call(_self);
                                                                        }, {php:'customphp/mysqlread.php'});                                                                                                                                
  } else {
    this._culture = ICulture.instance();
    this._verifyData();
  }
};

HandlePageBackendCultural.prototype._updateElements = function() {
  var _self = this;

  this._gui.name.value = this._culture.name;
  this._gui.name.onchange = function() { _self._culture.name = this.value; };
  
  this._gui.save.onclick = function() { if (_self._culture.name == '') {
                                          window.alert('名称不能为空');
                                        } else {
                                          new RequestUtils()._mwrite('iculture', [_self._culture], [], function() { history.back(); }, null); };
                                        }
  this._gui.cancel.onclick = function() { history.back(); };
};

